<?php echo $html->script('matriculas/addedit.js'); ?>
<div id="matriculaDialog" class="hide">
	<h2 id="summary"></h2>
	<?php echo $form->create('Matricula', array('controller'=>'matriculas', 'action'=>'actualizar')); 
			echo $form->input('id', array('label'=>false, 'div'=>false, 'class'=>'FormElement hide'));
			echo $form->hidden('programacion_id',array('value'=>$programacion[0]['Programacion']['id']));
			echo $form->hidden('fecha_actual',array('value'=>date('Y-m-d')));
			echo $form->text('matriculaestado_id', array('label'=>false, 'div'=>false, 'class'=>'FormElement hide'));
	?>
		<table class="tablaFormHeader"><?php echo
			'<tr>'
				.'<td>'.__('Codigo Carga Academica', true).'</td>'
				.'<td><div class="span-6">:&nbsp;'.$programacion[0]['Programacion']['id'].'</div></td>'
			.'</tr>'.
			'<tr>'
				.'<td>'.__('Curso', true).'</td>'
				.'<td><div class="span-6">:&nbsp;'.$programacion[0]['Curso']['descripcion'].'</div></td>'
			.'</tr>'
			.'<tr>'
				.'<td>'.__('Periodo', true).'</td>'
				.'<td><div class="span-6">:&nbsp;'.$programacion[0]['Periodo']['anio'] . ' - ' . $programacion[0]['Periodo']['ciclo'] .'</div></td>'
			.'</tr>'.
			'<tr>'
				.'<td>'.__('Docente', true).'</td>'
				.'<td><div class="span-6">:&nbsp;'.$programacion[0]['Persona']['nombre_completo'].'</div></td>'
			.'</tr>						
		</table>

		<br/>
		<table id="detallematriculasForm" class="tablaForm">
			<thead>
				<tr>
					<th class="header">Codigo - Alumno</th>
					<th class="header">Fecha</th>
					<th class="header">Monto</th>
					<td>';?><?php echo $form->button('+', array('type'=>'button','div'=>false, 'label'=>false, 'class'=>'ui-state-default ui-corner-all',
															'onClick'=>'agregarRegistro();')) ?></td>
				</tr>	
			</thead>
			<tbody><?php  //artificio para la generacion del primer detalle
			if(empty($this->data['detalles'])){
				$this->data['detalles'][0] = array('Persona'=>array('descripcion'=>''));
			}
			foreach($this->data['detalles'] as $key=>$matriculados):	
			echo
		 	'<tr class="ui-widget-content jqgrow ui-row-ltr">'
				.'<td>'.$form->input('detalles.'.$key.'.Persona.descripcion', array('readonly'=>false,'maxlenght'=>'2', 'label'=>false,'div'=>false, 'size'=>'50', 'class'=>'personaDescripcion text ui-widget-content required'))
						.$form->hidden('detalles.'.$key.'.Matricula.alumno_id',array('label'=>false,'class'=>'required'))
				.'</td>'
				.'<td>'.$form->input('detalles.'.$key.'.Matricula.fecha', array('readonly'=>true,'label'=>false,'div'=>false, 'size'=>'10', 'class'=>'readonly text_right text ui-widget-content')).'</td>'				
				.'<td>'.$form->input('detalles.'.$key.'.Matricula.monto', array('readonly'=>true,'label'=>false,'div'=>false, 'size'=>'10', 'class'=>'readonly text_right text ui-widget-content')).'</td>'				
				.'<td>'.$form->button('--', array('type'=>'button','div'=>false, 'label'=>false, 'class'=>'eliminarRegistro ui-state-default ui-corner-all','onClick'=>'eliminarRegistro($(this))')).'</td>'
			.'</tr>';
			endforeach;
			?></tbody>
		</table>
		<br/>
		<div class="prepend-9">
			<table class="tablaFormHeader">
				<tbody>
				<?php echo
				'<tr>'
					.'<td>'.$form->label('total',__('Total Matriculas',true)).'</td>'
					.'<td>'.$form->input('prc_total_sigv', array('class'=>'text_right ui-widget-content','div'=>false, 'label'=>false, 'size'=>10, 'readonly'=>true)).'</td>'
				.'</tr>';
				?>
				</tbody>
			</table>
		</div>
			
		
	<?php echo $form->end(); ?>
</div>